package crm.model.teacherPC.bannedList;

import java.util.ArrayList;

public class ApplicationBanned implements BannInterface{
	public ArrayList <Application> bannedList;
	public ApplicationBanned() {
		bannedList = new ArrayList<Application>();
	}

	public boolean match(String name) {
		for (Application appName: bannedList){
			System.out.println(name +"=="+ appName);
			if (name.toLowerCase().contains(appName.name.toLowerCase()) && appName.enable){
				return true;
			}
		}
		return false;
	}


	public Application getBannedBrowser(int i) {
		return bannedList.get(i);
	}

	@Override
	public ArrayList getList() {
		return bannedList;
	}

	public void addBann(String name) {
		bannedList.add(new Application(name, false));
	}
	public void addBann(String name, boolean enable) {
		bannedList.add(new Application(name, enable));
	}
	@Override
	public int getNOfBann() {
		// TODO Auto-generated method stub
		return bannedList.size();
	}

}
